package org.zk.dubbo_provider.service.impl;



import org.zk.dubbo_provider.dao.TeacherMapper;
import org.zk.entity.Teacher;
import org.zk.entity.TeacherBill;
import org.zk.service.TeacherService;
import com.alibaba.dubbo.config.annotation.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Alicelonely
 * @since 2019-12-11
 */
@Service(timeout = 10000)
public class TeacherServiceImpl  implements TeacherService {
    @Resource
    private TeacherMapper teacherMapper;

    @Override
    public List<Teacher> getAllTeacher() {
        return teacherMapper.getAllTeacher();


    }

    @Override
    public Teacher getTeacherById(int id) {
        return teacherMapper.getTeacherById(id);
    }

    @Override
    public void updateTeacherMoney(Map map) {
        teacherMapper.updateTeacherMoney(map);
    }

    @Override
    public void insertTixianTeacher(Map map) {
        teacherMapper.insertTeacherTixian(map);
    }

    @Override
    public void insertTixian(Map map) {
        teacherMapper.insertTixian(map);
    }

    @Override
    public int getTeacherBillById(int id) {
        return teacherMapper.getTeacherBillById(id);
    }

    @Override
    public void insertTeacherZhifubao(Map map) {
        teacherMapper.addTeacherZhifubao(map);
    }

    /**
     * 讲师用手机号登录（高顺）
     * @param teacher
     * @return
     */
    @Override
    public Teacher getTeacherLogin(Teacher teacher) {
        return teacherMapper.getTeacherLogin(teacher);
    }
    /**
     * 讲师用邮箱登录（高顺）
     * @param teacher
     * @return
     */
    @Override
    public Teacher getTeacherLoginByEmail(Teacher teacher) {
        return teacherMapper.getTeacherLoginByEmail(teacher);
    }

    @Override
    public int insertTeacherYes(Teacher teacher) {
        return teacherMapper.insertTeacherYes(teacher);
    }

    public TeacherMapper getTeacherMapper() {
        return teacherMapper;
    }

    public void setTeacherMapper(TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }


    //gs,12-31,用户购买成功，老师的账户金额增加
    @Override
    public void insertTeacherMoneyByCourse(Teacher teacher){
        teacherMapper.addTeacherMoneyByCourse(teacher);
    }

    @Override
    public Teacher selectHaveOrNoHave(Teacher teacher) {
        return teacherMapper.selectHaveOrNoHave(teacher);
    }


    //教师基本信息修改
    @Override
    public int updatetoTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }


    //修改头像
    @Override
    public int updatePic(Teacher teacher) {
        return teacherMapper.updatePic(teacher);
    }

    @Override
    public int updatePwdByPhone(Teacher teacher) {
        return teacherMapper.updatePwdByPhone(teacher);
    }

    @Override
    public void updateTeacherPhone(Teacher teacher) {
        teacherMapper.updateTeacherPhone(teacher);
    }

    @Override
    public List<Teacher> getShowTeacher() {
        return teacherMapper.getShowTeacher();
    }
}
